import { StrictMode } from 'react'
// React 19 适配 TDesign，需要引入适配器
import 'tdesign-react/es/_util/react-19-adapter.js';
import { createRoot } from 'react-dom/client'
import App from './App.jsx'
import { AuthProvider } from '../shared/state/auth.jsx'

const enableStrict = typeof import.meta !== 'undefined' ? !!import.meta.env.PROD : (typeof process !== 'undefined' ? process.env.NODE_ENV === 'production' : true)

createRoot(document.getElementById('root')).render(
  enableStrict ? (
    <StrictMode>
      <AuthProvider>
        <App />
      </AuthProvider>
    </StrictMode>
  ) : (
    <AuthProvider>
      <App />
    </AuthProvider>
  ),
)